import type { RouteRecordItem } from 'vc/src/router';
import { LAYOUT } from '@/router/constants';

export const LINK_PROFILE = '/profile';
export const LINK_PROFILE_INDEX = '/profile/index';
export const LINK_PROFILE_ACCOUNT = LINK_PROFILE + '/account';
export const LINK_PROFILE_MESSAGE = LINK_PROFILE + '/message';
export const LINK_PROFILE_PUSH = LINK_PROFILE + '/push';
export const LINK_PROFILE_COLLECTION = LINK_PROFILE + '/collection';
export const LINK_PROFILE_AUTH = LINK_PROFILE + '/auth';
export const LINK_PROFILE_PROTOCOL = LINK_PROFILE + '/privacy-policy';
export const LINK_PROFILE_PRIVACY_POLICY = LINK_PROFILE + '/user-agreement';
export const LINK_PROFILE_ABOUT = LINK_PROFILE + '/about';

const feat: RouteRecordItem = {
  path: LINK_PROFILE,
  component: LAYOUT,
  meta: {
    title: '我得',
    hideSide: true
  },
  children: [
    {
      path: LINK_PROFILE_INDEX,
      component: () => import('@/views/user/profile/index.vue'),
      redirect: LINK_PROFILE_ACCOUNT,
      meta: {
        title: '我的',
        hideSide: true
      },
      children: [
        {
          path: LINK_PROFILE_ACCOUNT,
          component: () => import('@/views/user/profile/account/index.vue'),
          meta: {
            title: '个人资料',
            hideSide: true,
            hideTab: true,
            currentActivePath: LINK_PROFILE_INDEX
          }
        },
        {
          path: LINK_PROFILE_MESSAGE,
          component: () => import('@/views/user/profile/message/index.vue'),
          meta: {
            title: '消息',
            hideSide: true,
            hideTab: true,
            currentActivePath: LINK_PROFILE_INDEX
          }
        },
        {
          path: LINK_PROFILE_PUSH,
          component: () => import('@/views/user/profile/push/index.vue'),
          meta: {
            title: '推送设置',
            hideSide: true,
            hideTab: true,
            currentActivePath: LINK_PROFILE_INDEX
          }
        },
        {
          path: LINK_PROFILE_COLLECTION,
          component: () => import('@/views/user/profile/collection/index.vue'),
          meta: {
            title: '收藏',
            hideSide: true,
            hideTab: true,
            currentActivePath: LINK_PROFILE_INDEX
          }
        },
        {
          path: LINK_PROFILE_AUTH,
          component: () => import('@/views/user/profile/auth/index.vue'),
          meta: {
            title: '认证',
            hideSide: true,
            hideTab: true,
            currentActivePath: LINK_PROFILE_INDEX
          }
        },
        {
          path: LINK_PROFILE_PRIVACY_POLICY,
          component: () => import('@/views/user/profile/user-agreement/index.vue'),
          meta: {
            title: '用户协议',
            hideSide: true,
            hideTab: true,
            currentActivePath: LINK_PROFILE_INDEX
          }
        },
        {
          path: LINK_PROFILE_PROTOCOL,
          component: () => import('@/views/user/profile/privacy-policy/index.vue'),
          meta: {
            title: '隐私政策',
            hideSide: true,
            hideTab: true,
            currentActivePath: LINK_PROFILE_INDEX
          }
        },
        {
          path: LINK_PROFILE_ABOUT,
          component: () => import('@/views/user/profile/about/index.vue'),
          meta: {
            title: '关于我们',
            hideSide: true,
            hideTab: true,
            currentActivePath: LINK_PROFILE_INDEX
          }
        }
      ]
    }
  ]
};

export default feat;
